<form
  action="/checkouts/payment/fxpay/doPay?order_number=2024052220213536"
  method="post" id="oempay-form" autocomplete="off">
  <input type='hidden' name='resolution' value='' />
  <input type='hidden' name='timezone' value='Etc/GMT-8' />
  <input type='hidden' name='os' value='Macintosh' />
  <input type='hidden' name='browser' value='Chrome 124' />
  <input type="hidden" value="" name="BrowserDate" id="BrowserDate">
  <input type="hidden" value="" name="BrowserDateTimezon" id="BrowserDateTimezon">
  <input type="hidden" value="" name="BrowserUserAgent" id="BrowserUserAgent">
  <input type="hidden" value="" name="BrowserName" id="BrowserName">
  <input type="hidden" value="" name="BrowserSystemLanguage" id="BrowserSystemLanguage">
  <input type="hidden" value="" name="Resolution" id="Resolution">
  <input type="hidden" value="" name="BrowserSystem" id="BrowserSystem">
  <input type="hidden" value="" name="BrowserLanguage" id="BrowserLanguage">
  <input type="hidden" value="" name="page_lang" id="page_lang">
  <input type="hidden" value="" name="oem_card_token">
  
  <div id="oempay-card" style="min-height: 115px;position: relative">
      <div class="second_party_card_load" id="pci_second_from_card_load" style="position: absolute;top:0;left: 0;width: 100%"><div class="cell-item"></div><div class="cell-item"></div></div>
  </div>
              <div style="text-align: left;margin-top: 10px;font-size: 12px;color: #4c4c4c;">
                <svg style="position: static;vertical-align: middle;" t="1701679681230" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7137" width="16" height="16"><path d="M484.010667 979.157333a562.304 562.304 0 0 1-385.152-534.229333V231.936a42.666667 42.666667 0 0 1 30.72-40.96l356.053333-103.893333A42.666667 42.666667 0 0 1 497.621333 85.333333a41.984 41.984 0 0 1 11.946667 1.749334l355.754667 103.893333a42.666667 42.666667 0 0 1 30.677333 40.96v213.077333a562.261333 562.261333 0 0 1-384.981333 534.144 42.666667 42.666667 0 0 1-13.482667 2.176 42.410667 42.410667 0 0 1-13.525333-2.176zM184.192 263.936v181.034667a477.098667 477.098667 0 0 0 313.301333 448.554666 477.056 477.056 0 0 0 313.130667-448.469333V263.978667l-313.045333-91.477334z m239.36 402.730667L282.026667 525.184a42.666667 42.666667 0 0 1 0-60.330667 42.666667 42.666667 0 0 1 60.373333 0l111.274667 111.274667 212.352-212.352a42.666667 42.666667 0 0 1 60.373333 0 42.666667 42.666667 0 0 1 0 60.373333l-242.517333 242.474667a42.666667 42.666667 0 0 1-30.208 12.501333 42.666667 42.666667 0 0 1-30.165334-12.458666z" fill="#25BB85" p-id="7138"></path></svg>
                <span style="margin-left: 5px;">Card information is guaranteed to be safe according to PCI DSS standards.</span>
            </div>
</form>


<script type="text/javascript">
  $(function () {
    $(".control-checkout-pay_btn").addClass("btn_disable");
    moi.createScript('https://cashier.oemapps.com/picresource/assets/elements-payment.js?v='+pciversion, function () {
      const oemsaaspaycard = oemsaaspay.create({ lang: storeConfig.language,paymentMethodsConfig:{"card_config":{"type":1,"list":[]}} });
      let getCardTokenLock = false;
      oemsaaspaycard.mount("#oempay-card");
      oemsaaspaycard.on('ready', function (data) {
        oemsaaspaycard.iframe.height = data.height;
        $(".control-checkout-pay_btn").removeClass("btn_disable");
        $('#pci_second_from_card_load').remove()
      })

      oemsaaspaycard.on('error', function (data) {
        if(getCardTokenLock){
          $(document).scrollTop($("input[name='payment_id']:checked").offset().top);
        }
        secondCardErrorCollect(data)
        getCardTokenLock = false;
      })

      oemsaaspaycard.on('change', function (data) {
        oemsaaspaycard.iframe.height = data.height;
      })

      oemsaaspaycard.on('token', function (data) {
        getCardTokenLock = false;
        if(data.token){
          $("input[name='oem_card_token']").val(data.token);
          $("#oempay-form").submit();
        }
      })

      oemsaaspaycard.on('valid', function (data) {
        window['pciFromValidCallback'] && window['pciFromValidCallback'](data)
      })


      window['pciFromValid'] = function(){
        oemsaaspaycard.valid();
      }

      

     $("#oempay-form").submit(function (event) {
        if(getCardTokenLock){
          return false
        }
        event.stopPropagation();
        if (!$("input[name='oem_card_token']").val()) {
          event.preventDefault();
          event.stopPropagation();
          getCardTokenLock = true;
          oemsaaspay.createToken(oemsaaspaycard, {store_id:68441})
          return false
        }
        return true
      });
    })
        $("#page_lang").val('en');
        $("#BrowserDateTimezon").val(new Date().getTimezoneOffset() / -60);
        $("input[name='resolution']").val(window.screen.width+"x"+window.screen.height);
      
  })

</script>